package com.cfec.educationplatform.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 存储和大模型的对话
 * @TableName tb_aichat_history
 */
@TableName(value ="tb_aichat_history")
@Data
public class TbAichatHistory {
    /**
     * 
     */
    @TableId
    private Integer historyId;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 用户名
     */
    private String userAccount;

    /**
     * 用户发送的消息
     */
    private String messageSend;

    /**
     * ai反馈的信息
     */
    private String messageGet;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 信息状态：0：弃用，1：使用
     */
    private String historyState;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbAichatHistory other = (TbAichatHistory) that;
        return (this.getHistoryId() == null ? other.getHistoryId() == null : this.getHistoryId().equals(other.getHistoryId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUserAccount() == null ? other.getUserAccount() == null : this.getUserAccount().equals(other.getUserAccount()))
            && (this.getMessageSend() == null ? other.getMessageSend() == null : this.getMessageSend().equals(other.getMessageSend()))
            && (this.getMessageGet() == null ? other.getMessageGet() == null : this.getMessageGet().equals(other.getMessageGet()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getHistoryState() == null ? other.getHistoryState() == null : this.getHistoryState().equals(other.getHistoryState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getHistoryId() == null) ? 0 : getHistoryId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUserAccount() == null) ? 0 : getUserAccount().hashCode());
        result = prime * result + ((getMessageSend() == null) ? 0 : getMessageSend().hashCode());
        result = prime * result + ((getMessageGet() == null) ? 0 : getMessageGet().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getHistoryState() == null) ? 0 : getHistoryState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", historyId=").append(historyId);
        sb.append(", userId=").append(userId);
        sb.append(", userAccount=").append(userAccount);
        sb.append(", messageSend=").append(messageSend);
        sb.append(", messageGet=").append(messageGet);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", historyState=").append(historyState);
        sb.append("]");
        return sb.toString();
    }
}